package com.nd.qa.shareplate.service.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nd.qa.shareplate.IDao.ApkMapper;
import com.nd.qa.shareplate.model.ApkInfo;
import com.nd.qa.shareplate.service.ApkService;

@Service("com.nd.qa.shareplate.service.ApkService")
public class ApkServiceImpl implements ApkService{

	@Autowired
	private ApkMapper apkDao;
	
	@Override
	public List<HashMap<String, Object>> queryApkById(HashMap<String, Object> paramMap) throws Exception{
		return apkDao.queryApkById(paramMap);
	}

	@Override
	public void insertApkInfo(ApkInfo apkInfo) throws Exception{
		apkDao.insertApkInfo(apkInfo);
	}

	@Override
	public void delAPKInfo(ApkInfo apkInfo) throws Exception{
		apkDao.delAPKInfo(apkInfo);
	}
    @Override
    public void updateAPKInfo(Integer apkId,String dentryId) throws Exception{
        HashMap<String,Object> paramMap = new HashMap<String,Object>();
        paramMap.put("apkId", apkId);
        paramMap.put("dentryId", dentryId);
        apkDao.updateAPKInfoDentry(paramMap);
    }
    
    @Override
    public void updateAPKUploadStatus(Integer apkId,Integer uploadStatus) throws Exception{
        HashMap<String,Object> paramMap = new HashMap<String,Object>();
        paramMap.put("apkId", apkId);
        paramMap.put("uploadStatus", uploadStatus);
        apkDao.updateAPKUploadStatus(paramMap);
    }
    
	@Override
	public List<HashMap<String, Object>> queryTotalApk(ApkInfo apkInfo) throws Exception{
		return apkDao.queryTotalApk(apkInfo);
	}

	@Override
	public List<ApkInfo> queryApkByUserId(ApkInfo apkInfo) {
		return apkDao.queryApkByUserId(apkInfo);
	}

}
